home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Source Code / C / Applications / Python 1.3 / Python 1.3 PPC / Tools / bgen / ae / Required_Suite.py < prev    next >
Encoding:
Python Source  |  1995-10-11  |  2.8 KB  |  98 lines  |  [TEXT/PYTH]

  1. """Suite Required Suite: Terms that every application should support
  2. Level 1, version 1
  3.  
  4. Generated from Moes:System folder:Extensions:Scripting Additions:Dialects:English Dialect
  5. AETE/AEUT resource version 1/0, language 0, script 0
  6. """
  7.  
  8. import addpack
  9. addpack.addpack('Tools')
  10. addpack.addpack('bgen')
  11. addpack.addpack('ae')
  12.  
  13. import aetools
  14. import MacOS
  15.  
  16. _code = 'reqd'
  17.  
  18. class Required_Suite:
  19.  
  20.     def open(self, _object, _attributes={}, **_arguments):
  21.         """open: Open the specified object(s)
  22.         Required argument: list of objects to open
  23.         Keyword argument _attributes: AppleEvent attribute dictionary
  24.         """
  25.         _code = 'aevt'
  26.         _subcode = 'odoc'
  27.  
  28.         if _arguments: raise TypeError, 'No optional args expected'
  29.         _arguments['----'] = _object
  30.  
  31.  
  32.         _reply, _arguments, _attributes = self.send(_code, _subcode,
  33.                 _arguments, _attributes)
  34.         if _arguments.has_key('errn'):
  35.             raise MacOS.Error, aetools.decodeerror(_arguments)
  36.         # XXXX Optionally decode result
  37.         if _arguments.has_key('----'):
  38.             return _arguments['----']
  39.  
  40.     def _print(self, _object, _attributes={}, **_arguments):
  41.         """print: Print the specified object(s)
  42.         Required argument: list of objects to print
  43.         Keyword argument _attributes: AppleEvent attribute dictionary
  44.         """
  45.         _code = 'aevt'
  46.         _subcode = 'pdoc'
  47.  
  48.         if _arguments: raise TypeError, 'No optional args expected'
  49.         _arguments['----'] = _object
  50.  
  51.  
  52.         _reply, _arguments, _attributes = self.send(_code, _subcode,
  53.                 _arguments, _attributes)
  54.         if _arguments.has_key('errn'):
  55.             raise MacOS.Error, aetools.decodeerror(_arguments)
  56.         # XXXX Optionally decode result
  57.         if _arguments.has_key('----'):
  58.             return _arguments['----']
  59.  
  60.     def quit(self, _no_object=None, _attributes={}, **_arguments):
  61.         """quit: Quit application
  62.         Keyword argument _attributes: AppleEvent attribute dictionary
  63.         """
  64.         _code = 'aevt'
  65.         _subcode = 'quit'
  66.  
  67.         if _arguments: raise TypeError, 'No optional args expected'
  68.         if _no_object != None: raise TypeError, 'No direct arg expected'
  69.  
  70.  
  71.         _reply, _arguments, _attributes = self.send(_code, _subcode,
  72.                 _arguments, _attributes)
  73.         if _arguments.has_key('errn'):
  74.             raise MacOS.Error, aetools.decodeerror(_arguments)
  75.         # XXXX Optionally decode result
  76.         if _arguments.has_key('----'):
  77.             return _arguments['----']
  78.  
  79.     def run(self, _no_object=None, _attributes={}, **_arguments):
  80.         """run: Sent to an application when it is double-clicked
  81.         Keyword argument _attributes: AppleEvent attribute dictionary
  82.         """
  83.         _code = 'aevt'
  84.         _subcode = 'oapp'
  85.  
  86.         if _arguments: raise TypeError, 'No optional args expected'
  87.         if _no_object != None: raise TypeError, 'No direct arg expected'
  88.  
  89.  
  90.         _reply, _arguments, _attributes = self.send(_code, _subcode,
  91.                 _arguments, _attributes)
  92.         if _arguments.has_key('errn'):
  93.             raise MacOS.Error, aetools.decodeerror(_arguments)
  94.         # XXXX Optionally decode result
  95.         if _arguments.has_key('----'):
  96.             return _arguments['----']
  97.  
  98.